package idiet.action;

import idiet.wizards.NewWizardAddMeal;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;

public class ActionAddMealWithWizard implements IWorkbenchWindowActionDelegate {
	private IWorkbenchWindow window;
	private WizardDialog dialog;
	private NewWizardAddMeal wizard;
	
	@Override
	public void run(IAction action) {
		// TODO Auto-generated method stub
		wizard=new NewWizardAddMeal();
		if(window!=null){
			dialog=new WizardDialog(window.getWorkbench().getActiveWorkbenchWindow().getShell(),wizard);
		}
		if(dialog!=null){
			dialog.open();
		}
	}

	@Override
	public void selectionChanged(IAction action, ISelection selection) {
		// TODO Auto-generated method stub

	}

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	@Override
	public void init(IWorkbenchWindow window) {
		// TODO Auto-generated method stub
		this.window=window;
	}

}
